<template>
  <router-view></router-view>
</template>

<script>
// #ifdef H5 
let script = document.createElement("script");
script.src = "https://res.wx.qq.com/open/js/jweixin-1.6.0.js"; //
document.body.appendChild(script); //
// #endif
import { mapMutations, mapGetters, mapActions } from "vuex";
export default {
  onLaunch: function () {
    console.log("App Launch");
  },
  onShow: function (options) {
    // 设置位置信息
    if (uni.getStorageSync("userLocationInfo")) {
      this.setUserLocationInfo(uni.getStorageSync("userLocationInfo"));
    }

    //设置选择的城市
    if (uni.getStorageSync("userInfo")) {
      console.log(uni.getStorageSync("userInfo"));
      this.setUserInfo(uni.getStorageSync("userInfo"));
    }
    //设置选择的城市
    if (uni.getStorageSync("SProvince")) {
      console.log(uni.getStorageSync("SProvince"));
      this.setcurProvince(uni.getStorageSync("SProvince"));
    }
    uni.getSystemInfo({
      success(res) {
		  if(res){
			   uni.setStorageSync("systemInfo", res);
		  }
      },
    });
	// if(this.setStatus){
	// 	this.setStatus()
	// }
	// if(this.setUserInfo){
	// 	this.setUserInfo()
	// }
    // this.setStatus();
    // this.setUserInfo();
  },
  onLoad(options) {},
  methods: {
    ...mapMutations("location", ["setUserLocationInfo", "setcurProvinceIndex", "setSelectCity", "setcurProvince"]),
    ...mapMutations("user", ["setUser", "setSystemInfo"]),
    ...mapActions("user", ["setUserInfo", "setStatus"]),
    ...mapMutations(["setJobIntention"]),
  },
  onHide: function () {
    console.log("App Hide");
  },
};
</script>

<style lang="scss">
/*每个页面公共css */
@import "uview-ui/index.scss";
/* 注入iconfont字体库 */

.container {
  width: 100%;
  padding: 0 0.625rem;
  box-sizing: border-box;
  font-size: 0.875rem;
}
</style>
